package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * Author:  LiuTao
 * Version: 1.0
 * Date:    2023-08-22  12:27
 */
interface Shape {
    void draw();
}
class Rect implements Shape {
    @Override
    public void draw() {
        System.out.println("矩形");
    }
}
class San implements Shape {
    @Override
    public void draw() {
        System.out.println("三角形");
    }
}

public class Test {
    public static void main(String[] args) {
        Shape[] shapes = {new Rect(), new San(), new San(), new Rect()};
        for (Shape shape : shapes) {
            shape.draw();
        }
        int[] array = {1,2,3,4,5,6,7,8,9};
        for (int x : array) {
            System.out.println(x);
        }
    }
}
